package com.medical.literature.search.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.medical.literature.search.dto.SearchRequest;
import com.medical.literature.search.dto.SearchResultItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 搜索Mapper接口
 */
@Mapper
public interface SearchMapper {
    
    /**
     * 全文搜索文献
     */
    IPage<SearchResultItem> searchLiterature(Page<SearchResultItem> page, 
                                            @Param("request") SearchRequest request,
                                            @Param("userId") Long userId);
    
    /**
     * 获取搜索建议
     */
    List<String> getSearchSuggestions(@Param("keyword") String keyword, 
                                     @Param("limit") Integer limit);
    
    /**
     * 获取热门关键词
     */
    List<String> getTopKeywords(@Param("limit") Integer limit);
    
    /**
     * 获取热门作者
     */
    List<String> getTopAuthors(@Param("limit") Integer limit);
}